/**
 * Copyright (c) 2021-2028, iron.guo 郭成杰 (jiedreams@sina.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.beluga.core.service;

import com.beluga.core.model.wechat.*;
import com.beluga.core.notify.WxPayRefundNotifyResult;

/**
 * @Author iron.guo
 * @Date 2022/5/3
 * @Description
 */
public interface WxPayService {
    /**
     * 获取微信支付令牌
     * @param unifiedOrder
     * @return
     */
    WxPayResult.JsapiResult payToken(WxBPayUnifiedOrder unifiedOrder);

    /**
     * 查询微信订单
     * @param transactionId
     * @param outTradeNo
     * @return
     */
    WxBPayOrderQuery queryWxOrder(String transactionId, String outTradeNo);

    /**
     * 关闭订单
     * @param outTradeNo
     * @return
     */
    WxBPayOrderCloseResult closeWxOrder(String outTradeNo);

    /**
     * 微信退款申请
     * @param request
     * @return
     */
    WxBPayRefundResult wxRefund(WxBPayRefundRequest request);

    /**
     * 解析微信退款异步回调
     * @param xmlData
     * @return
     */
    WxPayRefundNotifyResult parseWxRefundNotifyResult(String xmlData);

    /**
     * 微信退款查询
     * @param request
     * @return
     */
    WxBPayRefundQueryResult refundQuery(WxBPayRefundQueryRequest request);
}
